<div class="order-list-page" ng-if="pagedata.op == 'main'">
    <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">我的订单</div>
		<div class="fui-header-right"></div>
	</div>
	<div style="margin-top:58px"></div>
	<div id="tab" class="fui-tab fui-tab-danger">
        <a ng-class="{'external active':pagedata.params.status == 10}" href="javascript:" ng-click="pagedata.params.status =10;pagedata.getlist(1)">全部</a>
        <a ng-class="{'external active':pagedata.params.status == 0}" href="javascript:" ng-click="pagedata.params.status =0;pagedata.getlist(1)">待付款</a>
        <a ng-class="{'external active':pagedata.params.status == 1}" href="javascript:" ng-click="pagedata.params.status =1;pagedata.getlist(1)">已付款</a>
        <a ng-class="{'external active':pagedata.params.status == 2}" href="javascript:" ng-click="pagedata.params.status =2;pagedata.getlist(1)">已发货</a>
        <a ng-class="{'external active':pagedata.params.status == 3}" href="javascript:" ng-click="pagedata.params.status =3;pagedata.getlist(1)">已完成</a>
        <a ng-class="{'external active':pagedata.params.status == 4}" href="javascript:" ng-click="access_json('jy_quanhuo/refund/')">退款单</a>
    </div>
	<div class='fui-content navbar order-list' style="top:2rem">
	<div style="padding: 0.3rem 0.5rem">
	<div class="fui-list-group order-item" ng-repeat="item in pagedata.list">
                <a ng-click="access_json('jy_quanhuo/order/detail/id='+item.id)" class="fui-list external" style="padding: 0.42rem 0.5rem">
                    <div class="fui-list-inner">
                        <div class="subtitle">订单号:{{item.ordersn}}</div>
                    </div>
                    <div class="row-remark text-cancel" style="font-size: 0.65rem;text-align: right;">{{item.statustitle}}</div>
                    <div class="angle"></div>
                </a> 
                    <a ng-click="access_json('jy_quanhuo/order/detail/id='+item.id)">
                        <div class="fui-list-group-title lineblock">
                            <i class="icon jinyunicon icon-dianpu"></i> [{{item.merch.merchname || '商户'}}]-{{item.info.title}}
                        </div>
                    </a>
                    <a ng-if="item.status!=8" class="external" data-nocache="true" ng-click="access_json('jy_quanhuo/order/detail/id='+item.id)">
                        <div class="fui-list goods-list" ng-repeat="g in item.goods">
                            <div class="fui-list-media" style="">
                                <img class="" ng-src="{{tomedia(g.image) || '../core/resource/images/nopic.jpg'}}">
                            </div>
                            <div class="fui-list-inner">
                                <div class="text goodstitle towline">{{g.title || '主题名称'}}</div>
								<div class="fui-tag fui-tag-danger">{{item.typetitle || '互动活动'}}</div>
                            </div>
                            <div class="fui-list-angle">
                                ￥<span class="marketprice">{{g.price || '0.00'}}</span></div>
                        </div>
                    </a>
				 <div ng-if="item.status!=8 && item.sendtype>0" class="fui-list-group-title lineblock" style="padding:0.3rem;line-height:1.4">
					<span class="bold">
					<i class="icon icon-ditu" style="color:#f60;font-size:0.50rem"></i> 配送方式
					</span> 
					<span>：{{item.sendtypetitle}}</span>
					<span ng-if="item.sendtype==1" style="color:#999;font-size:0.55rem">
						({{item.address.pcd.province}} {{item.address.pcd.city}} {{item.address.pcd.district}} {{item.address.pcd.xiangxi}} {{item.address.address}})
					</span>
					<span ng-if="item.sendtype==1 && item.status==2" style="color:#999;font-size:0.55rem">
						({{item.express.express_name || '快递公司'}} {{item.express.expresssn || '没有快递单号'}})
					</span>
					<span ng-if="item.sendtype==2" style="color:#999;font-size:0.55rem">
						({{item.tihuo.pcd.province}} {{item.tihuo.pcd.city}} {{item.tihuo.pcd.district}} {{item.tihuo.pcd.xiangxi}} {{item.tihuo.address}})
					</span>
                </div>
                <div ng-if="item.status!=8" class="fui-list-group-title lineblock">
					<span style="color:#999;font-size:0.55rem"><i class="icon jinyunicon icon-shijian" style="color:#f60;font-size:0.50rem"></i> {{item.createtime}}</span>
                    <span class="status noremark">共 <span>1</span> 个 实付: <span class="text-danger">￥{{item.fee}}</span></span>
                </div>
            <div class="fui-list-group-title lineblock opblock">
				<span class="status noremark">
					<div ng-if="item.status == 1" ng-click="pagedata.show_code=true;pagedata.show_verify(item.hexiaourl,item.ordersn)" class="btn btn-sm btn-danger-o order-finish">核销</div>
					<div ng-if="item.status == 1 && item.ispay==1" ng-click="access_json('/refund/apply/orderid='+item.id)" class="btn btn-sm btn-default-o order-finish">申请退款</div>
					<div ng-if="item.status == 1 && item.sendtype==2" ng-click="post({'id':item.id},'//receive/id='+item.id)" class="btn btn-sm btn-danger-o order-finish">确认自取</div>
					<div ng-if="item.status == 2 && item.sendtype==1" ng-click="post({'id':item.id},'//receive/id='+item.id)" class="btn btn-sm btn-danger-o order-finish">确认收货</div>
					<div ng-if="item.status == 0" ng-click="pay_submit({},'//pay/id='+item.id,'/order/','jy_quanhuo/order/')" class="btn btn-sm btn-danger-o order-finish">支付订单</div>
				</span>
            </div>
        </div>
	</div>
	 </div>
	<div class="content-empty" ng-show="!pagedata.list || pagedata.list.length == 0">
		  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">您暂时没有订单！</p>
	</div>
</div>
<div class="order-list-page" ng-if="pagedata.op == 'detail'">
    <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">订单详情</div>
		<div class="fui-header-right"></div>
	</div>
	<div class='fui-content member-page navbar' style="top:0">
		<div class="fui-list-group merchgroup">
			<div class="fui-list jump">
                <a class="fui-list-media">
                    <img class="round" src="{{tomedia(pagedata.member.avatar) || '../core/resource/images/nopic.jpg'}}" />
                </a>
                <div class="fui-list-inner">
					<div class="title" style="font-size:0.65rem">手机号：{{pagedata.member.mobile}}</div>
					<div class="title" style="font-size:0.65rem">昵称：{{pagedata.member.nickname}}</div>
					<div ng-if="pagedata.order.express.express_name" class="title" style="font-size:0.65rem">已发货：({{pagedata.order.express.express_name || '快递公司'}} {{pagedata.order.express.expresssn || '没有快递单号'}})</div>
                </div>
                <a class="jump" href="javascript:;">
					
				</a>
            </div>
		</div>
		<div class="weui_cells">
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>活动标题</span>
					</div>
					<div class="weui_cell_ft" >{{pagedata.item.title}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>活动类型</span>
					</div>
					<div class="weui_cell_ft" ><i class="fui-tag fui-tag-red">{{pagedata.order.typetitle}}</i></div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>下单人</span>
					</div>
					<div class="weui_cell_ft">{{pagedata.order.name}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>联系电话</span>
					</div>
					<div class="weui_cell_ft">{{pagedata.order.mobile || '无'}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>订单时间</span>
					</div>
					<div class="weui_cell_ft">{{pagedata.order.createtime}}</div>
			</div>
			<div ng-if="pagedata.order.address" class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>订单地址</span>
					</div>
					<div class="weui_cell_bd weui_cell_primary">{{pagedata.order.address}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>取货方式</span>
					</div>
					<div class="weui_cell_ft"><i class="fui-tag fui-tag-blue">{{pagedata.order.sendtypetitle}}</i></div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>备注</span>
					</div>
					<div class="weui_cell_ft">{{pagedata.order.remark || '无'}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>订单费用</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.order.fee">{{pagedata.order.fee}}元</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>实际支付</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.order.fee">{{pagedata.order.fee}}元</div>
			</div>
		</div>
		<div class="weui_cells_title"><strong style="font-size: 0.8rem;">参与内容</strong> / <small>Con&nbsp;Jielong</small></div>
		<div class="weui_cells">
				<div class="weui_cell" ng-repeat="f in pagedata.order.diyform">
						<div class="weui_cell_bd weui_cell_primary">
							<span>{{f.title}}</span>
						</div>
						<div ng-if="f.type ==1 || f.type ==2 || f.type ==6 || f.type ==8 || f.type ==9" class="weui_cell_ft">{{f.data}}</div>
						<div ng-if="f.type ==3 || f.type ==10" class="weui_cell_ft">
						<ul class="weui_uploader_files" ng-if="f.data">
							  <li class="weui_uploader_file" style="background-image:url({{tomedia(f.data)}})"></li>
						</ul>
						</div>
						<div ng-if="f.type ==4" class="weui_cell_ft">
							<span class="jylabel jylabel-f60">{{f.data}}</span>
						</div>
						<div ng-if="f.type ==5" class="weui_cell_ft">
							<span class="jylabel jylabel-f60" ng-repeat="(k,v) in f.data track by $index">{{v}}</span>
						</div>
						<div ng-if="f.type ==7" class="weui_cell_ft">{{f.data.province}} {{f.data.district}} {{f.data.city}} {{f.data.xiangxi}}</div>
						<div ng-if="f.type ==18" class="weui_cell_ft">￥<span class="price">{{f.data || '0.00'}}</span></div>
				</div>
				<div ng-if="!pagedata.order.diyform || pagedata.order.diyform.length<1" class="weui_cell">
					<div class="content-empty" style="margin-top:0.5rem">
						  <p style="color: #999;font-size: .75rem">无内容...</p>
					</div>
				</div>
		</div>
	</div>
</div>
<!--留言-->
<div id="showexpress"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
	<div class="modal-dialog" style="width:100%;left:0;bottom:0">
		<div class="modal-bottom">
			<div class="fui-cell-group">
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:100px;font-size:0.9rem">发货</div>
				</div>
				<div class="c" style="color:#999;font-size:0.65rem;padding-top:0.5rem">
						{{pagedata.post.address.name}} {{pagedata.post.address.mobile}} ({{pagedata.post.address.pcd.province}} {{pagedata.post.address.pcd.city}} {{pagedata.post.address.pcd.district}} {{pagedata.post.address.pcd.xiangxi}} {{pagedata.post.address.address}})
				</div>
				<div class="fui-cell">
						<div class="fui-cell-text">快递公司</div>					
						<div class="fui-cell-remark" style="color:#61bba7">
							<select class="r" ng-model="pagedata.post.express_id" name="expressno">
								<option ng-repeat="ex in pagedata.express" ng-selected="pagedata.post.express_id==ex.id" value="{{ex.id}}">{{ex.name}}</option>
							</select>
						</div>
				</div>
				<div class="fui-cell">
					<div class="fui-cell-text">快递单号</div>
					<div class="fui-cell-text">
						<input type="text" placeholder="请输入快递单号" class="fui-input r" ng-model="pagedata.post.expresssn" id="subtitle" />
					</div>
				</div>
			</div>
			<div class="fui-navbar">
				<a aria-hidden="true" data-dismiss="modal" ng-click="post(pagedata.post,'fa')" class="nav-item btn btn-success confirmbtn">确定</a>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.show_code" class="popup">
			<div class="popup-body">
			<div class="popup-center" style="border-radius:0.2rem;">
			<i class="closed icon icon-cuowu" ng-click="pagedata.show_code=false"></i>
			<p class="c" style="padding: 0.5rem;color:#999">请将二维码出示给店员</p>
			<div class="img_box c" id="show_verify_ewm">
			</div>
			<div class="cav_code c">{{pagedata.nowordersn}}</div>
			<div class="error c">
				<p class="c" style="padding: 0 1.3rem;padding-bottom:0.6rem">温馨提示：为了更好的保护您利益,请不要轻易将您的核销二维码泄露给他人</p>
			</div>
			</div>
			</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script type="text/javascript">
scope.pagedata.showfa=function(id,address){
	scope.pagedata.post.id=id;
	scope.pagedata.post.address=address;
	$('#showexpress').modal();
}
if(scope.pagedata.op!='detail'){
	scope.loading = true;  //状态标记
	scope.isnodata = false;
	scope.pagedata.list =[];
	//滚动加载
	var page = 1;
	scope.pagedata.getlist=function(type){
		scope.tool.get_list('jy_quanhuo/order/list/',type)
	}
	scope.pagedata.getlist(1);
	scope.pagedata.scroll_bottom=function(){
		if(!scope.isnodata && !scope.loading){
			scope.pagedata.getlist();
		}
	}
}
scope.pagedata.show_verify=function(url,code){
	scope.tool.qr(url,'show_verify_ewm',150)
	scope.pagedata.nowordersn=code;
	scope.$evalAsync();
}	
</script>